import { upload, post } from '@/utils/axios.js'

// 上传图片
export const uploadImage = (formData) => upload('/api/upload/image', formData, 'multipart/form-data')

// 上传文件
export const uploadFile = (formData) => upload('/api/upload/file', formData, 'multipart/form-data')

// 删除文件
export const deleteFile = (fileUrl) => {
  const formData = new FormData()
  formData.append('imageUrl', fileUrl)
  return upload('/api/upload/delete', formData, 'application/x-www-form-urlencoded')
}